/*
 * Copyright (c) 2006-2021, Halo team
 *
 * SPDX-License-Identifier: GPLv3
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-09-11     Eywen        the first version
 */


#ifndef TEMPERATURE__H_
#define TEMPERATURE__H_

#include "drivers/drv_temprature.h"

typedef struct _temperature_ops temperature_ops_t;

typedef struct _temperature{
    temperature_type_t type;
    float temperature;                   /* 当前的温度 */

    void *temperautre_sensor;            /* 温度传感器处理指针 */

    temperature_ops_t *ops;
}temperature_t;

typedef struct _temperature_ops{
    bool (*init)(temperature_t *device, ...);
    float (*temperature_get)(temperature_t *device);
}temperature_ops_t;

bool temperature_register(temperature_t *device, temperature_type_t type);
bool temperature_init(temperature_t *device, ...);
temperature_t *temperature_create(temperature_type_t type);
#endif // TEMPERATURE__H_
